home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Surfer: Getting Started
/
Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin
/
pc
/
mac
/
bonus
/
peter_le
/
finger-1
/
my_units
/
mytransl.uni
< prev
next >
Wrap
Text File
|
1992-02-24
|
1KB
|
49 lines
unit MyTranslate82728;
{ This code is part of the Finger/Fingerd source code, written in THINK Pascal 4 }
{ Copyright 1991-1992 Peter N Lewis }
{ If you use this code, you must give me credit in your about box and documentation }
{ This is part of my generic library of routines }
interface
const
translateResType = 'taBL';
translateOutResID = 128;
translateInresID = 129;
type
transTable = array[0..255] of signedByte;
procedure GetTrans (id: integer; var trans: transTable);
implementation
uses
MyPreferences;
procedure GetTrans (id: integer; var trans: transTable);
var
th: handle;
s: str255;
tfs: FSSpec;
tres, i: integer;
begin
GetPrefsFSSpec(tfs);
tres := HOpenResFile(tfs.vRefNum, tfs.parID, 'Translate 7<->8', fsRdPerm);
th := GetResource(translateResType, id);
if th = nil then
for i := 0 to 255 do
{$PUSH}
{$R-}
trans[i] := i
{$POP}
else begin
BlockMove(th^, @trans, SizeOf(trans));
ReleaseResource(th);
end;
if tres <> -1 then
CloseResFile(tres);
end;
end.